﻿#Region "IMPORTS"
Imports DAO

#End Region

Public Class MateriaPrimaService
    Inherits Service(Of MateriaPrima)

#Region "CONSTRUTOR(S)"

    Public Sub New()
        MyBase.New()
    End Sub

#End Region

    Private ReadOnly Property Dao() As MateriaPrimaDao
        Get
            If (Me._dao Is Nothing) Then
                Me._dao = New MateriaPrimaDao()
            End If
            Return Me._dao
        End Get
    End Property

#Region "METODOS ABSTRATOS"

    Public Overrides Function Insert(ByVal modelo As MateriaPrima) As MateriaPrima
        Return Dao.Insert(modelo)
    End Function

    Public Overrides Sub Delete(ByVal modelo As MateriaPrima)
        Dao.Delete(modelo)
    End Sub

    Public Overrides Function Find(ByVal NHQL As String) As IList(Of MateriaPrima)
        Return Dao.Find(NHQL)
    End Function
    
    Public Overrides Function GetAll() As IList(Of MateriaPrima)
        Return Dao.GetAll()
    End Function

    Public Overrides Function GetById(ByVal id As Integer) As MateriaPrima
        Return Dao.GetById(id)
    End Function

    Public Overrides Sub Update(ByVal modelo As MateriaPrima)
        Dao.Update(modelo)
    End Sub

    Public Overrides Function Search(ByVal condicoes As IList(Of Condicao)) As IList(Of MateriaPrima)
        Return Dao.Search(condicoes)
    End Function

#End Region

End Class
